﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for NhaSXDAL
/// </summary>
public class NhaSXDAL
{
	public NhaSXDAL()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public DataTable fnG_GetAllNhaSX()
    {
        string strSQL = "select * FROM NhaSanXuat;";
        return DataProvider.GetData(strSQL);
    }
    public int fnG_InsertNhaSX(NhaSanXuatEntity NhaSanXuat)
    {
        string strSQL = "INSERT INTO NhaSanXuat VALUES(@TenNSX)";
        return DataProvider.ExecuteNonQuery(strSQL, "@TenNSX", NhaSanXuat.TenNSX);
    }
    public int fnG_SelectMaxMaNSX()
    {
        string strSQL = "select max(MaNSX) from NhaSanXuat";
        return (int)DataProvider.ExecuteScalar(strSQL);
    }
}